import React, { useState }from 'react';
// 输入组件
import { Input } from 'antd';
// 按钮组件 和 按钮组件ts类型声明
import { Button, } from 'antd';
interface Props {
    onSerach:any,
    children?:any
}
function LhSearch(props:Props) {
      // input框 内容的状态
      let [patient,setPatient] = useState('')
      // 获取input的值
      let handleChange = (e:any)=>{
          // 将获取的值更新到状态
          setPatient(e.target.value)
      }
    return (
        <div className='chooseSearch'>
            <Input placeholder="请输入病人姓名" value={patient} onChange={handleChange} />
            <Button type="primary" size='small' onClick={()=>{props.onSerach(patient)}}>搜索</Button>
            {/* 放置插槽 */}
            {props.children}
        </div>
    );
}

export default LhSearch;